﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Benchmark.Db.Base.DataObjects;

namespace Benchmark.Db.Base
{
    public interface IDbBenchmarkConnectionV1
        //where T : class, IDataObject, new()
    {

        string Name { get; }

        string Version { get; }

        #region Initializing
        void Initialize<T>() where T : class, IDataObject, new();

        void EnsureIndexes<T>() where T : class, IDataObject, new();

        void ClearDB();
        #endregion

        void Insert<T>(T[] records) where T : class, IDataObject, new();

        void BulkInsert<T>(T[] records) where T : class, IDataObject, new();

        void Load<T, K>(string keyColumnName, K[] keys) where T : class, IDataObject, new();

        void Update<T>(string keyColumnName, T[] records) where T : class, IDataObject, new();

        void BulkUpdate<T>(string keyColumnName, T[] records) where T : class, IDataObject, new();

        void Delete<T, K>(K[] keys) where T : class, IDataObject, new();

        void BeginTransaction();

        void CommitTransaction();

        void RollbackTransaction();
    }

    //Deadlock'u algilamak icin yukleme, silme, insert ve update'i bir arada yapmak? "Dirty Load"
    //Transaction ve rollback...

}
